/*
 * Copyright (c) 2023-2025 elsfs Authors. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.elsfs.cloud.module.ai.api.entity;

import cn.idev.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.SqlCondition;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.elsfs.cloud.common.core.entity.BaseSpellEntity;

/**
 * ai知识库文档
 *
 * @author zeng
 * @version V1.0.0-M2
 * @since 2025-06-20
 */
@EqualsAndHashCode(callSuper = true)
@Schema(description = "ai知识库文档")
@Data
@ColumnWidth(20)
@TableName("ai_knowledge_doc")
public class AiKnowledgeDoc extends BaseSpellEntity {

  /** 主键 */
  @TableId(type = IdType.ASSIGN_ID)
  @Schema(description = "主键")
  private String knowledgeDocId;

  /** 知识库id */
  @Schema(description = "知识库id")
  private String knowledgeId;

  /** 标题 */
  @Schema(description = "标题")
  @TableField(whereStrategy = FieldStrategy.NOT_EMPTY, condition = SqlCondition.LIKE)
  private String title;

  /** 知识库文档类型 文本 文件 网页 */
  @Schema(description = "类型")
  private String knowDocType;

  /** 内容 */
  @Schema(description = "内容")
  private String content;

  /**
   * 元数据,存储上传文件的存储目录以及网站站点 <br>
   * eg. {"filePath":"https://xxxxxx","website":"https://hellp.elsfs.com"}
   */
  @Schema(description = "元数据")
  private String metadata;

  /** 文档状态 complete 已完成 building 构建中 draft 草稿 failed 失败 */
  @Schema(description = "文档状态")
  private String docStatus;
}
